package com.own.business.log.login.persistence.entity.po;

import com.own.component.elastic.aop.ElasticFieldInteger;
import com.own.component.elastic.aop.ElasticFieldLong;
import com.own.component.elastic.aop.ElasticFieldText;
import com.own.component.elastic.entity.BaseElasticPo;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import lombok.experimental.FieldNameConstants;

import java.io.Serializable;

/**
 * LogLoginElasticPo
 *
 * @author chenxueli
 * @date 2023-12-20 10:08:22
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@FieldNameConstants
public class LogLoginElasticPo extends BaseElasticPo<LogLogin> implements Serializable {

    @ElasticFieldText(name = "登录账号", keyword = true)
    private String loginAccount;

    @ElasticFieldText(name = "登录类型", keyword = true)
    private String loginType;

    @ElasticFieldText(name = "登录编码", keyword = true)
    private String loginCode;

    @ElasticFieldLong(name = "用户id")
    private Long fkUserId;

    @ElasticFieldText(name = "用户名", keyword = true)
    private String userName;

    @ElasticFieldText(name = "ip地址", keyword = true)
    private String ip;

    @ElasticFieldText(name = "客户端", keyword = true)
    private String client;

    @ElasticFieldText(name = "token", keyword = true)
    private String token;

    @ElasticFieldText(name = "操作内容")
    private String extra;

    @ElasticFieldInteger(name = "登录状态 1=成功 2=失败")
    private Integer status;

    @ElasticFieldText(name = "链路id", keyword = true)
    private String traceId;

}
